package apis

import (
	"encoding/json"
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
)

type base struct {
}

func (b base) GetTeacherInfo(ctx *gin.Context) *TeacherClaims {
	value, _ := ctx.Get(jwt.JwtPayloadKey)
	bytes, _ := json.Marshal(value)
	var obj TeacherClaims
	_ = json.Unmarshal(bytes, &obj)
	return &obj
}
